<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<script type="text/javascript" src="/manage/assert/plugin/area/area.js" charset="utf-8"></script>

<script type="text/javascript">
function queryParment() {
    var equipmenttype=$("#manage_equipmenttype").combobox('getValue');
    $('#manage_alarm_parment').combobox({
        valueField: 'value',
        textField: 'name'
    })
    var arr=[]
    $.post("/manage/demo/equipment/queryalarmParment.html",{"equipmenttype":equipmenttype},function (r) {
        debugger
        $.each(r.rows,function (i,v) {
            arr[i]={"id":v.parameter,"text":v.parameter}
            $("#manage_alarm_parment").append("<option value=\""+v.parameter+"\">"+v.parameter+"</option>");
        })
        $('#rwlb').combobox('clear');
        $("#rwlb").combobox("loadData", arr);
    })
}
    $( function(){
        $("#manage_equipmenttype").combobox({
            onSelect:function(record) {
                queryParment();
            }
        });
    })

setTimeout(function (r) {

    queryParment()
},500)
</script>
<div>
    <form id="manage_alarm_editform"
          action="${pageContext.request.contextPath}/manage/demo/equipment/saveAlarm.html"
          method="post">
        <jodd:form bean="org" scope="request">
            <table class="tableForm" width="100%">
                <tr>
                    <th width="100">设备：</th>
                    <td>
                        <select name="equipment" editable="false"  id="manage_equipmenttype" onchange="queryParment()" style="height:27px;width: 178px" panelHeight="auto" class="easyui-combobox">
                            <c:forEach items="${equipments}" var="e" >
                                <option value="${e.value}_${e.title}">${e.title}</option>
                            </c:forEach>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th width="100">设备参数：</th>
                    <td>
                        <input class="easyui-combobox" id="rwlb" name="parment" tyle="height:27px;width: 200px" data-options="valueField:'id', textField:'text', panelHeight:'auto'" >
                    </td>
                </tr>
                <tr>
                    <th  width="100">报警值：</th>
                    <td><input type="text" name="value" size="48" class="easyui-validatebox text" validType="byteLength[1,32]"
                               data-options="required:true"/></td>
                </tr>
                <tr>
                    <th  width="100">备注：</th>
                    <td><input type="text" name="remarks" size="48" class="easyui-validatebox text" validType="byteLength[1,32]"
                               data-options="required:true"/></td>
                </tr>
            </table>
        </jodd:form>
    </form>
</div>
